<?
require_once("conn.php");
?>
<table>
	<tr>
		<td colspan="3">
			<span>Category : </span>
			<select id="or_cat" onchange="updateOrCat()">
				<option value="">&nbsp;</option>
				<?
					$sql = "SELECT * FROM pch_category;";
					$query = mysql_query($sql);
					while($row = mysql_fetch_array($query)){
					?>
						<option value="<?=$row["id"]?>"><?=$row["category_name"]?></option>
					<?
					}
				?>
			</select>
		</td>
	</tr>
	<tr>
		<td><div id="showOrItem"></div></td>
		<td>
			<div id="showdetail1" style="display:none;">
				<input type="hidden" id="or_itemname">
				<input type="hidden" id="or_unittext">
				<input type="hidden" id="or_index" value="1">
				<input type="text" id="or_amount" size="2" value="" onkeypress="return numbersonly(event)">&nbsp;
			</div>
		</td>
		<td>
			<div id="showdetail2" style="display:none;">
				<select id="or_unit" onchange="updateOrUnit()">
					<option value="">&nbsp;</option>
					<?
						$sqlP = "SELECT * FROM pch_unit ORDER BY unit_name;";
						$queryP = mysql_query($sqlP);
						while($rowP = mysql_fetch_array($queryP)){
					?>
						<option value="<?=$rowP["id"]?>"><?=$rowP["unit_name"]?></option>
					<?
						}
					?>
				</select>
				<span>&nbsp;Quick <input type="checkbox" id="quick"></span>
			</div>
			
		</td>
	</tr>
	<tr>
		<td colspan="3">
			<span style="float:left"><input type="button" id="btnAddOrder" onclick="addOrderItem()" value="Add" style="width:100px;">&nbsp;</span><span style="float:right"><input type="button" id="btnCheckOut" onclick="orderCheckOut()" value="Send" style="width:100px;" disabled></span>
		</td>
	</tr>
</table><br>
<table id="or_list" width="750" border="1">
	<tr>
		<td colspan="4">รายการสั่งของลงเกาะวันที่  <?=date("d/m/Y");?></td>
	</tr>
	<tr>
		<td width="600">Product Name</td>
		<td width="50" align="center">Amount</td>
		<td width="50" align="center">Unit</td>
		<td width="50">&nbsp;</td>
	</tr>
</table>
